#include "stdafx.h"
#include "render/Surface.h"
#include <allegro5/allegro.h>
#include <allegro5/allegro_image.h>

namespace Render
{

Surface Load(const char* filename) 
{
	return Surface((Surface_Raw*) al_load_bitmap(filename));
}

Surface CreateSurface(int width, int height)
{
	return Surface((Surface_Raw*) al_create_bitmap(width, height));
}

int GetWidth(const SurfacePtr surface)
{
	return al_get_bitmap_width((ALLEGRO_BITMAP*) surface);
}

int GetHeight(const SurfacePtr surface)
{
	return al_get_bitmap_height((ALLEGRO_BITMAP*) surface);
}

}

void FreeSurface(void* p)
{
	al_destroy_bitmap((ALLEGRO_BITMAP*) p);
}
